﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="User.cs" company="DissingNelleman">
//   
// All rights reserved. </copyright>
// <summary>
//   The user.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace ServiceLibrary.Models.Domain
{
    using NHibernate.Mapping.ByCode.Conformist;

    using ServiceLibrary.Models.Base;

    /// <summary>
    /// The user.
    /// </summary>
    public class User : Entity
    {
        #region Public Properties

        /// <summary>
        /// Gets or sets the email.
        /// </summary>
        public virtual string Email { get; set; }

        /// <summary>
        /// Gets or sets the encrypted password.
        /// </summary>
        public virtual string EncryptedPassword { get; set; }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        public virtual string Name { get; set; }

        /// <summary>
        /// Gets or sets the phone number.
        /// </summary>
        public virtual string PhoneNumber { get; set; }

        /// <summary>
        /// Gets or sets the username.
        /// </summary>
        public virtual string Username { get; set; }

        public virtual bool IsActive { get; set; }

        #endregion
    }

    /// <summary>
    /// The user mapping.
    /// </summary>
    public class UserMapping : ClassMapping<User>
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="UserMapping"/> class.
        /// </summary>
        public UserMapping()
        {
            this.Property(x => x.Username);
            this.Property(x => x.Name);
            this.Property(x => x.EncryptedPassword);
            this.Property(x => x.Email);
            this.Property(x => x.PhoneNumber);
            this.Property(x => x.IsActive);
        }

        #endregion
    }
}